﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ListaTelefonicaMEM.Formularios
{
    public partial class frmConsulta2 : Form
    {
        public frmConsulta2()
        {
            InitializeComponent();

            string[] str = lt.Contatos.Select(c => c.Nome[0].ToString().ToUpper()).Distinct().OrderBy(p => p).ToArray();

            treeViewPadraoLoadSegmentado1.CarregaNivel(str);

        }

        private void treeViewPadraoLoadSegmentado1_Expandido(object sender, EventArgs e)
        {
            string[] str = lt.Contatos.Select(c => c.Nome).Where(n => n[0].ToString().ToUpper() == treeViewPadraoLoadSegmentado1.SelectedNode.Text).OrderBy(p => p).ToArray();
            treeViewPadraoLoadSegmentado1.CarregaNivel(str);
        }

        private void treeViewPadraoLoadSegmentado1_OnAnterior(object sender, EventArgs e)
        {
            MessageBox.Show("anterior");
        }

        private void treeViewPadraoLoadSegmentado1_OnProximo(object sender, EventArgs e)
        {
            MessageBox.Show("proximo");
        }

        
    }
}
